# Contributor: Michael Mason <ms13sp@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=dialog
pkgver=1.3.20200327
_pkgver=${pkgver%.*}-${pkgver##*.}
pkgrel=0
pkgdesc="Script interpreter providing curses widgets"
url="https://invisible-island.net/dialog/dialog.html"
arch="all"
options="!check"  # No test suite.
license="LGPL-2.1-only"
makedepends="ncurses-dev"
subpackages="$pkgname-doc $pkgname-static"
source="https://invisible-mirror.net/archives/dialog/dialog-$_pkgver.tgz"
builddir="$srcdir/$pkgname-$_pkgver"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--with-ncursesw
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

static() {
	pkgdesc="$pkgdesc (static library)"
	depends=""

	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib
}

sha512sums="c8c7ccd86fa189a2b6739320f59f127512e53f908ed257280099f8c45754da98d2095835d0c14090cd071af0ed6e8ff95f9938f5ca8027b0b7001c7fd746fe59  dialog-1.3-20200327.tgz"
